import 'dart:typed_data';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

class SystemOverlay {
  static const String messageInfoDialog = "messageInfoDialog";
  static const String playBackDialog = "playBackDialog";
}

class AppContent {
  static AppContent? _instance;
  static String fontHyqmd = "hyqmd";
  static String fontTimeIdly = "time_idly";

  // 加载所有图像资源

  static List<String> MAHJONG_IMAGES = [
    'message/ask_money.png',
    'mahjong/background/gaming_center.jpg',
    'mahjong/background/hallbg.jpg',
    'mahjong/background/login_bg.jpg',
    'mahjong/user/bottom/usercard_background.png',
    'mahjong/user/bottom/export_background.png',
    'mahjong/user/bottom/export_up.png',
    'mahjong/user/left/export_background.png',
    'mahjong/user/left/usercard.png',
    'mahjong/user/left/dark_card.png',
    'mahjong/user/left/darkcard.png',
    'mahjong/user/right/export_background.png',
    'mahjong/user/right/usercard.png',
    'mahjong/user/right/dark_card.png',
    'mahjong/user/top/export_background.png',
    'mahjong/user/top/usercard.png',
    'mahjong/user/header/header_border.png',
    'mahjong/user/header/common_header.png',
    'mahjong/commons/card_tips.png',
    'mahjong/util/game_info.png',
    'mahjong/commons/tips.png',
    'mahjong/commons/reading.png',
    'mahjong/commons/diamond.png',
    'direction/top.png',
    'direction/bottom.png',
    'direction/right.png',
    'direction/left.png',
    'mahjong/util/microphone.png',
    'mahjong/util/micro_close.png',
    'mahjong/util/message.png',
    'mahjong/util/menu.png',
    'mahjong/util/number.png',
    'mahjong/dice/dice1.png',
    'mahjong/dice/dice2.png',
    'mahjong/dice/dice3.png',
    'mahjong/dice/dice4.png',
    'mahjong/dice/dice5.png',
    'mahjong/dice/dice6.png',
    'mahjong/dice/dice7.png',
    'mahjong/dice/dice8.png',
    'mahjong/dice/dice9.png',
    'mahjong/card/lai.png',
    'mahjong/card/que.png',
    'mahjong/card/south_hand_tile_1.png',
    'mahjong/card/south_hand_tile_2.png',
    'mahjong/card/south_hand_tile_3.png',
    'mahjong/card/south_hand_tile_4.png',
    'mahjong/card/south_hand_tile_5.png',
    'mahjong/card/south_hand_tile_6.png',
    'mahjong/card/south_hand_tile_7.png',
    'mahjong/card/south_hand_tile_8.png',
    'mahjong/card/south_hand_tile_9.png',
    'mahjong/card/south_hand_tile_11.png',
    'mahjong/card/south_hand_tile_12.png',
    'mahjong/card/south_hand_tile_13.png',
    'mahjong/card/south_hand_tile_14.png',
    'mahjong/card/south_hand_tile_15.png',
    'mahjong/card/south_hand_tile_16.png',
    'mahjong/card/south_hand_tile_17.png',
    'mahjong/card/south_hand_tile_18.png',
    'mahjong/card/south_hand_tile_19.png',
    'mahjong/card/south_hand_tile_21.png',
    'mahjong/card/south_hand_tile_22.png',
    'mahjong/card/south_hand_tile_23.png',
    'mahjong/card/south_hand_tile_24.png',
    'mahjong/card/south_hand_tile_25.png',
    'mahjong/card/south_hand_tile_26.png',
    'mahjong/card/south_hand_tile_27.png',
    'mahjong/card/south_hand_tile_28.png',
    'mahjong/card/south_hand_tile_29.png',
    'mahjong/action/BAR.png',
    'mahjong/action/CALL.png',
    'mahjong/action/HU.png',
    'mahjong/action/PASS.png',
    'mahjong/action/PREPARE.png',
    'mahjong/action/BUMP.png',
    'mahjong/action/BANKER.png',
    'mahjong/action/LISTEN.png',
    'mahjong/action/peng/peng_1.png',
    'mahjong/action/peng/peng_2.png',
    'mahjong/action/peng/peng_3.png',
    'mahjong/action/peng/peng_4.png',
    'mahjong/action/peng/peng_5.png',
    'mahjong/action/peng/peng_6.png',
    'mahjong/action/peng/peng_7.png',
    'mahjong/action/peng/peng_8.png',
    'mahjong/action/peng/peng_9.png',
    'mahjong/action/peng/peng_10.png',
    'mahjong/action/peng/peng_11.png',
    'mahjong/action/peng/peng_12.png',
    'mahjong/action/gang/gang_1.png',
    'mahjong/action/gang/gang_2.png',
    'mahjong/action/gang/gang_3.png',
    'mahjong/action/gang/gang_4.png',
    'mahjong/action/gang/gang_5.png',
    'mahjong/action/gang/gang_6.png',
    'mahjong/action/gang/gang_7.png',
    'mahjong/action/gang/gang_8.png',
    'mahjong/action/gang/gang_9.png',
    'mahjong/action/gang/gang_10.png',
    'mahjong/action/gang/gang_11.png',
    'mahjong/action/gang/gang_12.png',
    'mahjong/action/hu/hu_1.png',
    'mahjong/action/hu/hu_2.png',
    'mahjong/action/hu/hu_3.png',
    'mahjong/action/hu/hu_4.png',
    'mahjong/action/hu/hu_5.png',
    'mahjong/action/hu/hu_6.png',
    'mahjong/action/hu/hu_7.png',
    'mahjong/action/hu/hu_8.png',
    'mahjong/action/hu/hu_9.png',
    'mahjong/action/hu/hu_10.png',
    'mahjong/action/hu/hu_11.png',
    'mahjong/action/hu/hu_12.png',
    'mahjong/action/ting/ting_1.png',
    'mahjong/action/ting/ting_2.png',
    'mahjong/action/ting/ting_3.png',
    'mahjong/action/ting/ting_4.png',
    'mahjong/action/ting/ting_5.png',
    'mahjong/action/ting/ting_6.png',
    'mahjong/action/ting/ting_7.png',
    'mahjong/action/ting/ting_8.png',
    'mahjong/action/ting/ting_9.png',
    'mahjong/action/ting/ting_10.png',
    'mahjong/action/ting/ting_11.png',
    'mahjong/action/ting/ting_12.png',
  ];

  static List<SystemAudio> MAHJONG_SOUND = [
    SystemAudio.init(
        filePath: 'assets/audio/sounds/card/card1.mp3',
        code: "card1",
        audio: null),
    SystemAudio.init(
        filePath: 'assets/audio/sounds/card/card2.mp3',
        code: "card2",
        audio: null),
    SystemAudio.init(
        filePath: 'assets/audio/sounds/card/card3.mp3',
        code: "card3",
        audio: null),
    SystemAudio.init(
        filePath: 'assets/audio/sounds/card/card4.mp3',
        code: "card4",
        audio: null),
    SystemAudio.init(
        filePath: 'assets/audio/sounds/card/card5.mp3',
        code: "card5",
        audio: null),
    SystemAudio.init(
        filePath: 'assets/audio/sounds/card/card6.mp3',
        code: "card6",
        audio: null),
    SystemAudio.init(
        filePath: 'assets/audio/sounds/card/card7.mp3',
        code: "card7",
        audio: null),
    SystemAudio.init(
        filePath: 'assets/audio/sounds/card/card8.mp3',
        code: "card8",
        audio: null),
    SystemAudio.init(
        filePath: 'assets/audio/sounds/card/card9.mp3',
        code: "card9",
        audio: null),
    SystemAudio.init(
        filePath: 'assets/audio/sounds/card/card11.mp3',
        code: "card11",
        audio: null),
    SystemAudio.init(
        filePath: 'assets/audio/sounds/card/card12.mp3',
        code: "card12",
        audio: null),
    SystemAudio.init(
        filePath: 'assets/audio/sounds/card/card13.mp3',
        code: "card13",
        audio: null),
    SystemAudio.init(
        filePath: 'assets/audio/sounds/card/card14.mp3',
        code: "card14",
        audio: null),
    SystemAudio.init(
        filePath: 'assets/audio/sounds/card/card15.mp3',
        code: "card15",
        audio: null),
    SystemAudio.init(
        filePath: 'assets/audio/sounds/card/card16.mp3',
        code: "card16",
        audio: null),
    SystemAudio.init(
        filePath: 'assets/audio/sounds/card/card17.mp3',
        code: "card17",
        audio: null),
    SystemAudio.init(
        filePath: 'assets/audio/sounds/card/card18.mp3',
        code: "card18",
        audio: null),
    SystemAudio.init(
        filePath: 'assets/audio/sounds/card/card19.mp3',
        code: "card19",
        audio: null),
    SystemAudio.init(
        filePath: 'assets/audio/sounds/card/card21.mp3',
        code: "card21",
        audio: null),
    SystemAudio.init(
        filePath: 'assets/audio/sounds/card/card22.mp3',
        code: "card22",
        audio: null),
    SystemAudio.init(
        filePath: 'assets/audio/sounds/card/card23.mp3',
        code: "card23",
        audio: null),
    SystemAudio.init(
        filePath: 'assets/audio/sounds/card/card24.mp3',
        code: "card24",
        audio: null),
    SystemAudio.init(
        filePath: 'assets/audio/sounds/card/card25.mp3',
        code: "card25",
        audio: null),
    SystemAudio.init(
        filePath: 'assets/audio/sounds/card/card26.mp3',
        code: "card26",
        audio: null),
    SystemAudio.init(
        filePath: 'assets/audio/sounds/card/card27.mp3',
        code: "card27",
        audio: null),
    SystemAudio.init(
        filePath: 'assets/audio/sounds/card/card28.mp3',
        code: "card28",
        audio: null),
    SystemAudio.init(
        filePath: 'assets/audio/sounds/card/card29.mp3',
        code: "card29",
        audio: null),
    SystemAudio.init(
        filePath: 'assets/audio/sounds/action/BAR.mp3',
        code: "BAR",
        audio: null),
    SystemAudio.init(
        filePath: 'assets/audio/sounds/action/BUMP.mp3',
        code: "BUMP",
        audio: null),
    SystemAudio.init(
        filePath: 'assets/audio/sounds/action/CALL.mp3',
        code: "CALL",
        audio: null),
    SystemAudio.init(
        filePath: 'assets/audio/sounds/action/DICE.mp3',
        code: "DICE",
        audio: null),
    SystemAudio.init(
        filePath: 'assets/audio/sounds/action/SHUFFLE.mp3',
        code: "SHUFFLE",
        audio: null),
    SystemAudio.init(
        filePath: 'assets/audio/sounds/action/HU.mp3', code: "HU", audio: null),
    SystemAudio.init(
        filePath: 'assets/audio/sounds/action/TING.mp3',
        code: "TING",
        audio: null),
    SystemAudio.init(
        filePath: 'assets/audio/sounds/action/EXPORT.mp3',
        code: "EXPORT",
        audio: null),
    SystemAudio.init(
        filePath: 'assets/audio/sounds/action/PREPARE.mp3',
        code: "PREPARE",
        audio: null),
    SystemAudio.init(
        filePath: "assets/audio/sounds/message/1.mp3",
        code: "message1",
        audio: null),
    SystemAudio.init(
        filePath: "assets/audio/sounds/message/2.mp3",
        code: "message2",
        audio: null),
    SystemAudio.init(
        filePath: "assets/audio/sounds/message/3.mp3",
        code: "message3",
        audio: null),
    SystemAudio.init(
        filePath: "assets/audio/sounds/message/4.mp3",
        code: "message4",
        audio: null),
    SystemAudio.init(
        filePath: "assets/audio/sounds/message/5.mp3",
        code: "message5",
        audio: null),
    SystemAudio.init(
        filePath: "assets/audio/sounds/message/6.mp3",
        code: "message6",
        audio: null),
    SystemAudio.init(
        filePath: "assets/audio/sounds/message/7.mp3",
        code: "message7",
        audio: null),
    SystemAudio.init(
        filePath: "assets/audio/sounds/message/8.mp3",
        code: "message8",
        audio: null),
    SystemAudio.init(
        filePath: "assets/audio/sounds/message/9.mp3",
        code: "message9",
        audio: null),
    SystemAudio.init(
        filePath: "assets/audio/sounds/message/10.mp3",
        code: "message10",
        audio: null),
    SystemAudio.init(
        filePath: "assets/audio/sounds/message/11.mp3",
        code: "message11",
        audio: null),
    SystemAudio.init(
        filePath: "assets/audio/sounds/message/12.mp3",
        code: "message12",
        audio: null),
  ];

  static final TextStyle menuFontSize = TextStyle(
      color: const Color.fromARGB(255, 255, 255, 255),
      fontSize: 12.sp,
      fontWeight: FontWeight.bold);
  static final List<Color> colors = [
    Colors.red,
    Colors.orange,
    Colors.yellow,
    Colors.green,
    Colors.blue,
    Colors.indigo,
    Colors.purple,
  ];

  AppContent._();

  factory AppContent() {
    _instance ??= AppContent._();
    return _instance!;
  }

  static List<String> MESSAGE_SOUND = [
    "不要吵了，不要吵了，吵啥嘛吵，专心玩游戏把。",
    "不要走，决战到天亮啊。",
    "大家好很高兴见到各位。",
    "诶，各位不好意思啊，我得离开一会儿。",
    "和你合作真是太愉快了啊。",
    "快点啊都等得我花儿都谢了。",
    "您的牌打的也挺好的啊。",
    "你是妹妹还是哥哥啊。",
    "咋交个朋友吧，能告诉我你怎么联系的嘛。",
    "下次咋们再玩把，我会想念大家的。",
    "再见了我会想念大家的。",
    "怎么又断线了，网络怎么这么差啊。"
  ];

  /// Color: 0xFFFFFFFF
  static const Color white = Color(0xFFFFFFFF);

  /// Color: 0xFF000000
  static const Color black = Color(0xFF000000);

  /// Color: 0xFF0C32A4
  static const Color darkBlue = Color(0xFF0C32A4);

  /// Color: 0xFFFFEE02
  static const Color yellow = Color(0xFFFFEE02);

  /// Color: 0xFFE5AB05
  static const Color orange = Color(0xFFE5AB05);

  /// Color: 0xFFF03939
  static const Color red = Color(0xFFF03939);

  /// Color: 0xFF4B94F6
  static const Color blue = Color(0xFF4B94F6);

  /// Color: 0x00000000
  static const Color transparent = Color(0x00000000);

  /// Color: 0xFFE33B2D
  static const Color loadingDarkRed = Color(0xFFE33B2D);

  /// Color: 0xFFEC5E2B
  static const Color loadingLightRed = Color(0xFFEC5E2B);

  /// Color: 0xFF4087F8
  static const Color loadingDarkBlue = Color(0xFF4087F8);

  /// Color: 0xFF6CCAE4
  static const Color loadingLightBlue = Color(0xFF6CCAE4);

  /// Color: 0xFF274E54
  static const Color crtBackground = Color(0xFF274E54);
}

class MessageType {
  static const int VOICE = 1;
  static const int CHART = 2;
  static const int ACTION = 3;
}

class SystemAudio {
  late String filePath;
  late String code;
  Uint8List? audio;
  SystemAudio(this.filePath, this.code, this.audio);
  SystemAudio.init({required this.filePath, required this.code, this.audio});
}
